UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TWllFOeeu6R13o30cmGt/qbbu+ZJlV+4gIDWG2Afq0U=' 
WHERE 
  key_id = 'add22e628d6c124f075d40edefd63e5108340430a792fe725a356e2bc05cdf18' 
  AND (
    token = 'TWllFOeeu6R13o30cmGt/qbbu+ZJlV+4gIDWG2Afq0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028