UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XXRB0spyy+fWMW0O4zr4e7OE9H/fWBOYG9la8Hfr1Eg=' 
WHERE 
  key_id = '0f9cc5f454a39efa20ac11760d80a23b9e4e3322b6ab523849d5aecc38f08818' 
  AND (
    token = 'XXRB0spyy+fWMW0O4zr4e7OE9H/fWBOYG9la8Hfr1Eg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019