UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fxrUeUkQZYZkt3um0rPah6YhWUakL7aOERNVLA2QcXA='
WHERE
key_id = '4a749a4f93272339b4f70929c8041e5dfb96c992f8e1236e841666c86193c7f1'
AND (
token = 'fxrUeUkQZYZkt3um0rPah6YhWUakL7aOERNVLA2QcXA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)