UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tcqAeERgq9xHwAQoDmRwua2OpwnkKRTDkhNrdamOtSg=' 
WHERE 
  key_id = '7aefc7aa34c000b70c6758bb461e5096006d71423f1c30eb12aa659cd888fc6c' 
  AND (
    token = 'tcqAeERgq9xHwAQoDmRwua2OpwnkKRTDkhNrdamOtSg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035