UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rc1PM5VM7fvrEbslmFXM0jDjk4saLbIuuaF44MpHWsk=' 
WHERE 
  key_id = 'f2ab83f82ba14eb74ae652c1456341c095577e91a5ae85e74f4c78bbbcaec773' 
  AND (
    token = 'rc1PM5VM7fvrEbslmFXM0jDjk4saLbIuuaF44MpHWsk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024