UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UEckToZSMykXWll/Pc/lQxTgeiFMMHuZUCdX6rXrbCs=' 
WHERE 
  key_id = '1430d38f446843ec72e30788a2f5862c17e0dd15784e57d2bc859b5e57708323' 
  AND (
    token = 'UEckToZSMykXWll/Pc/lQxTgeiFMMHuZUCdX6rXrbCs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035