UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'voLYeTV4Mh2q45V7oAy7cyKHumObEua6IYGpxSOelwI='
WHERE
key_id = '5b338e1b78a7e0b75e38cbd9f8447564ffdb24e3ddd9d180a547f7d72e7417cd'
AND (
token = 'voLYeTV4Mh2q45V7oAy7cyKHumObEua6IYGpxSOelwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)