UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+9HsO1r5p4l8YqAYzLT/qIom0EmFZPJkjn/mMWkUPzs=' 
WHERE 
  key_id = '972ea150059b4f9e917eb104e5239dbfbadcba369b8fa9f45444a9acd3e9a64d' 
  AND (
    token = '+9HsO1r5p4l8YqAYzLT/qIom0EmFZPJkjn/mMWkUPzs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026