UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2R0Qcvfx7SsI3xhnEEI/LhyBrK/zlmVBMdxG8/oaGjI=' 
WHERE 
  key_id = '298fb20178112c8e8f74df38f577530e108a932ab2cc7898ae429fbb42ecd7ea' 
  AND (
    token = '2R0Qcvfx7SsI3xhnEEI/LhyBrK/zlmVBMdxG8/oaGjI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028