UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oIZQ3ql9zGj6wytEVEtxFhw9fH6i/XpKBdBeeXI/190=' 
WHERE 
  key_id = '54ce5f76b46503d439c3cbb247a095f880ddb4152e8cf48c451780a99df1520c' 
  AND (
    token = 'oIZQ3ql9zGj6wytEVEtxFhw9fH6i/XpKBdBeeXI/190=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029