UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'P+IX9qlnZHbYg91mMf2DEFk8+H4UWPLUQFMQezaHF98=' 
WHERE 
  key_id = '2af0eeb19abe7a92ee0d0761f937c5baec358cb590fcc5d5c008e88c4d972580' 
  AND (
    token = 'P+IX9qlnZHbYg91mMf2DEFk8+H4UWPLUQFMQezaHF98=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021