UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xh8dr5BPzPcRy6s+FvKAPB68/gDWVEee3d6bxinc3sM='
WHERE
key_id = 'adb44964b068e48876c523a34a2b9a1fc522450d3fd11610650a578356cbfdc1'
AND (
token = 'Xh8dr5BPzPcRy6s+FvKAPB68/gDWVEee3d6bxinc3sM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)