UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eR5z2Epzem0NJP3+RxuUJzgcgCbjZFtumdIUPSVTbKc='
WHERE
key_id = '9d89a20fee0dd1cc97b827e9fdc5729fcb997311d0909755af4f10624df5110c'
AND (
token = 'eR5z2Epzem0NJP3+RxuUJzgcgCbjZFtumdIUPSVTbKc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)