UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2Iy4nwmjrbbAlOWIvcReOtK/4gyM++WYqE4evmRimGo=' 
WHERE 
  key_id = '6dfbb86b2f6f6dc424f3c42ffbb7c28139c11df70256f3b040361e76aaa94dcf' 
  AND (
    token = '2Iy4nwmjrbbAlOWIvcReOtK/4gyM++WYqE4evmRimGo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034