UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AlpqVekvI7RFkt4JGXvlURX9l81is2pI//tZdvMrd90=' 
WHERE 
  key_id = 'fb72efe48eb46591bdaf8698cdf4d66d88db14cf056906a6fcdb03c39e0b0fca' 
  AND (
    token = 'AlpqVekvI7RFkt4JGXvlURX9l81is2pI//tZdvMrd90=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045