UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eStEluMcdG1WX8BSlBmIh10x8WIajebwwcBEg1ssOxk='
WHERE
key_id = '41804b6de4bc2e4f38b6557665118d3c38ad7f9640bd401c912f651afa8217c3'
AND (
token = 'eStEluMcdG1WX8BSlBmIh10x8WIajebwwcBEg1ssOxk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)