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