UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/wCGhRiWYdia5rO8/y2ipHWgLQUg7kMz4u97WLhfPZk='
WHERE
key_id = 'c18917781bd68874bbb05456a73d527d4cef1d68218a0dc658e6053833a13962'
AND (
token = '/wCGhRiWYdia5rO8/y2ipHWgLQUg7kMz4u97WLhfPZk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)