UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2e4a+7lBLvp2RZ8GXbRLuMRky/eF9Jczd+3ETCmd948=' 
WHERE 
  key_id = '6282bacc82ce52b235702329e4c5d0697cb3bd985a63b66d49df4471db7f3a4a' 
  AND (
    token = '2e4a+7lBLvp2RZ8GXbRLuMRky/eF9Jczd+3ETCmd948=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047