UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'D4KPw68wwZPmF6Kr2Xh9GZWkEC6rpYh3v4suNaYy5Fc=' 
WHERE 
  key_id = 'acbb7d9762b74affd2ad780eeec7ca29177d3ccf2317df97e50e373b394562e6' 
  AND (
    token = 'D4KPw68wwZPmF6Kr2Xh9GZWkEC6rpYh3v4suNaYy5Fc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017