UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LpcMLSodnBut0l/BCL64/FGoqdzkxA2fFtNdS9hMsKY='
WHERE
key_id = 'f082ddcc6c1563ac906ad9244e5f007006c8f071de19357cfaf95556cf4cc900'
AND (
token = 'LpcMLSodnBut0l/BCL64/FGoqdzkxA2fFtNdS9hMsKY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)