UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IzJxCod/khspyXlXzMoBY4pdOTOc0lJi9zgh2i2HfaI=' 
WHERE 
  key_id = '1af3663af7527288867fd09920b969c8a182ec679d216d3442c2f76a4c72f72f' 
  AND (
    token = 'IzJxCod/khspyXlXzMoBY4pdOTOc0lJi9zgh2i2HfaI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031