UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '079KkvQ054608UsBPIu64NpvUKO9FSIvqKBIV/yw2Z8='
WHERE
key_id = '569f08e0f6420833293bf309f27db747cfc7d33d54192d699d4144e0faa8207c'
AND (
token = '079KkvQ054608UsBPIu64NpvUKO9FSIvqKBIV/yw2Z8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)