UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R/hZznr8Siev6End6nDKbhmkR+bW9y0/9Xz8Q7Q9Mqw=' 
WHERE 
  key_id = 'ef9dee56b7b91b6461ced9273ca6eea9f18405964420e0c5d78b16cd9bd0b0d0' 
  AND (
    token = 'R/hZznr8Siev6End6nDKbhmkR+bW9y0/9Xz8Q7Q9Mqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025