UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SXxUWGVjWXX7HOGFBYFtEQw+3BM5dQ3H1+cOXvuhNPU='
WHERE
key_id = 'e09b469cb0867b0a85d8a65cc21c1a63dd9d50a4fe994f83cd6577accd31cc49'
AND (
token = 'SXxUWGVjWXX7HOGFBYFtEQw+3BM5dQ3H1+cOXvuhNPU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)