UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '761ayIZ0GDXFjO7cxYk3DZ0f/nW8d8jj+0kUb+SVzZs='
WHERE
key_id = 'fed3be4b9a93ae8b8d181e0e6046f4591eb270377be355f37fa81114b0d47a22'
AND (
token = '761ayIZ0GDXFjO7cxYk3DZ0f/nW8d8jj+0kUb+SVzZs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)