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