UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vXHRmNcly7DoS8pQXr8+p42dMao06xjHEuyMATQ/v98='
WHERE
key_id = 'd203b106ce22d80a3bf69726ce865a876582aaae68fbf1562302b63778e7bdce'
AND (
token = 'vXHRmNcly7DoS8pQXr8+p42dMao06xjHEuyMATQ/v98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)