UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ohdtC8slL1RT6QGRV8XTEM+lmpxrD6+F4V0dTW8XIE=' 
WHERE 
  key_id = '3a9f129d9b04b714cba6c832e8acfcd8dea50732ce07650a51f988bb4c19f9d0' 
  AND (
    token = '2ohdtC8slL1RT6QGRV8XTEM+lmpxrD6+F4V0dTW8XIE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031