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