UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ca6f5wdTYTRuPgwxnWFxJC4itw0K/yvirh11Zrs9gpc=' 
WHERE 
  key_id = '1890eb1638cc1ab5ada8d4fed6576faf6cefe2a296bd9fb86c5ba7e26f65bb9b' 
  AND (
    token = 'ca6f5wdTYTRuPgwxnWFxJC4itw0K/yvirh11Zrs9gpc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031