UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OTv2Gk7eYRS97Do33d4v34x75sl3RjG8PAQRzQaxJIk='
WHERE
key_id = '3377eb13616bd16f0719ca6be6d1057f86ae217275c350a9d0ab380c50d91343'
AND (
token = 'OTv2Gk7eYRS97Do33d4v34x75sl3RjG8PAQRzQaxJIk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)