UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Jd2hqlZYPQ+2SIlXarD7FfwRM9KQ/Zdq3bjf6ZhVq34='
WHERE
key_id = 'c74a20a1c6d0c20d52ecf31c47e40f3d74803b7757cf0c43b2e8b249308dc1b9'
AND (
token = 'Jd2hqlZYPQ+2SIlXarD7FfwRM9KQ/Zdq3bjf6ZhVq34='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)