UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RNMkYDVDMktacaVvXyR673TglowPxKu+q/yLiYkROn8='
WHERE
key_id = 'bd833d5eae6a3e44f107eb9a851fdf820a675e284a007ca816d53db13940235a'
AND (
token = 'RNMkYDVDMktacaVvXyR673TglowPxKu+q/yLiYkROn8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)