UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IYY/7oyqS3b8/4ZgyyOPNo3bsIU4EohYZ3elZfd347k=' 
WHERE 
  key_id = 'cd23cade5c19eafbccad4e7f9dc0884ab2b627e958425cf7c81467a8de0a7d8e' 
  AND (
    token = 'IYY/7oyqS3b8/4ZgyyOPNo3bsIU4EohYZ3elZfd347k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030