UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ZNOWEF/OKow7Uq6FfXz02Npnk7X0cgxre2OHUEJ/u4='
WHERE
key_id = '27dd860600859807981fe3566d5a582b772bc39df2bbf8bc8dd7a2be8c14ffd1'
AND (
token = '3ZNOWEF/OKow7Uq6FfXz02Npnk7X0cgxre2OHUEJ/u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)