UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8KMOinFnPc+YMV3vz/f9K49ZC019wUiQqPZEgUPbje4=' 
WHERE 
  key_id = '86574ceae488b6a030e99675745a80216c549aca80fe26c23a0d7c7f0fa2a1a7' 
  AND (
    token = '8KMOinFnPc+YMV3vz/f9K49ZC019wUiQqPZEgUPbje4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040