UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MuXiwa2d0jz1u4m0PXmeffSTX5kgxC/9/51ImdzdTH8='
WHERE
key_id = '0543ae075f02522a36f15f302dbd450a6bbecb00db0fe5ebb1d718ea96b6cc5b'
AND (
token = 'MuXiwa2d0jz1u4m0PXmeffSTX5kgxC/9/51ImdzdTH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)