UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8xXEOfwGpSEtqtDCyteeAsYZbcv+DpjeJnHsbeieO9I='
WHERE
key_id = 'd22603dccb4d440eb9c592aca31e59f5aafb2f553dd32f457e843746ced8b482'
AND (
token = '8xXEOfwGpSEtqtDCyteeAsYZbcv+DpjeJnHsbeieO9I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)