UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3oYRgGC5fCjcFo23exFd16WrBtPfDosyxAks82U7nLM='
WHERE
key_id = 'df2f83c0825ba3f8a94e3458ab1b911a178ebe00aec779faf445dda43a603c82'
AND (
token = '3oYRgGC5fCjcFo23exFd16WrBtPfDosyxAks82U7nLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)