UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JXSjN21f1BRW8GKUbMVOLc09p/LCqFcvZmR9dijb0h8='
WHERE
key_id = '0c0ab3943758fa54dade3abc70987f8a69cf5f5e742fbaefe02f24f7982813ed'
AND (
token = 'JXSjN21f1BRW8GKUbMVOLc09p/LCqFcvZmR9dijb0h8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)